<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

</head>

<body>
    <div id='app'>
        <input type="file" name="" id="" @change='handleChange'>
        <button @click='postFile'>上传文件</button>
        <div>
        </div>

    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                file: null
            },
            methods: {
                handleChange(e) {
                    console.log(e);
                    this.file = e.currentTarget.files[0]
                },
                postFile(e) {
                    const formdata = new FormData()
                    formdata.append('file', this.file)
                    formdata.append('fileUseForEnum', 'DEFAULT')
                    axios.post('http://192.168.0.173:8088/api/nos/upload/image', formdata).then(res => {
                        debugger
                    })
                }
            }



        })
    </script>
</body>

</html>